home *** CD-ROM | disk | FTP | other *** search
/ VisualFX for ImageFX / VisualFX for Image FX 2 - Disc 2.iso / setup / 04 / 01.rexx
Encoding:
OS/2 REXX Batch file  |  1997-08-22  |  5.5 KB  |  239 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11.  
  12. parse arg Num Frames
  13. options results
  14. address "IMAGEFX.1"
  15.     ReDraw On
  16.     RequestResponse "Do You Need Instructions?"
  17.     if rc = 0 then do
  18.         call Docs()
  19.         end    
  20. if exists("libs:flyer.library") then do
  21.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  22.         RequestNotify 'Flyer Must Be Running First!'
  23.         exit
  24.         end
  25.     call OpenFlyStuff()
  26.  
  27.  
  28.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  29.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  30.     if rc ~= 0 then do
  31.         call CloseStuff()
  32.         exit 0
  33.         end
  34.     else do
  35.         IAType = RESULT.1
  36.            end
  37.  
  38.     call GetA()
  39. end
  40. else do
  41.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  42.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  43.     if rc ~= 0 then do
  44.         call CloseStuff()
  45.         exit 0
  46.         end
  47.     else do
  48.         IAType = RESULT.1+2
  49.            end
  50.  
  51.     call GetA()
  52. end
  53.  
  54.     KillBrush
  55.     i = Start
  56.     call LoadA()
  57.  
  58.     Learn "RAM:"left(Num,2,'0') NoHeader Quiet Force
  59.     Address FLY_1 WaitFX
  60.     Learn Stop Quiet Force
  61.  
  62. if FlyOn = 1 then
  63.     call CloseStuff()
  64.  
  65. call open TempFile,"RAM:"strip(Num),W
  66. call writeln TempFile,PicAName
  67. call writeln TempFile,Start
  68. call writeln TempFile,End
  69. call writeln TempFile,IAType
  70. call close TempFile
  71. exit
  72.  
  73.  
  74.  
  75. Docs:
  76.     text1 = '"This effect records anything and everything you do"'
  77.     text2 = '"from with in Image FX. It turns on the record mode"'
  78.     text3 = '"and what ever you do to the first frame is repeated"'
  79.     text4 = '"automatically on all the rest of the frames. Once"'
  80.     text5 = '"you select your images, it brings up the first frame."'
  81.     text6 = '"Next the record mode is turned on. Now select what"'
  82.     text7 = '"you want to do. Brighten it, blur it, emboss it, etc."'
  83.     text8 = '"When you are done, close the VFX window to go on."'
  84.  
  85.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  86.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  87.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  88.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  89.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  90.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  91.     Gadget.7  = 'TEXT LE=10 TE=64 LB='text7' '
  92.     Gadget.8  = 'TEXT LE=10 TE=74 LB='text8' '
  93.     Gadget.9= 'END'
  94.     NewComplexRequest  '"Instructions For Effect #01"' Gadget 386 86
  95. return
  96.  
  97.  
  98. GetFile:
  99.     parse Arg Title, Path
  100.     Address FLY_1 SetString Path
  101.     Address FLY_1 GetFileNameNT Title
  102. return result
  103.  
  104. GetFileName: procedure  
  105.    ARG CompleteName
  106.    c = lastpos("/",CompleteName)
  107.    if c = 0 then c = lastpos(":",CompleteName)
  108.    return substr(CompleteName, c + 1)
  109.  
  110.  
  111. GetA:
  112.  if IAType = 0 then do
  113.     call Switcher(TOSW)
  114.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  115.     Name = GetFileName(PicAName)
  116.     if Name = "" then do
  117.         Address FLY_1 OK_TEXT " OK "
  118.         Title = "You Must Enter A Valid Clip Name To Use!"
  119.         Address FLY_1 FYINT Title
  120.         Address FLY_1 Quit
  121.         call Switcher(TOWB)
  122.         exit
  123.         end
  124.     Address FLY_1 SetFileName PicAName
  125.     Address FLY_1 GetClipLength PicAName
  126.     End = result
  127.     Start = 0
  128.     Address FLY_1 Program "5"
  129.     Address FLY_1 StartNum Start
  130.     Address FLY_1 EndNum End
  131.     Address FLY_1 CurrentNum "0"
  132.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  133.     Start = word(result,1)*2
  134.     End = word(result,2)*2
  135.     Start  = Start + 1
  136.     End = End +2
  137.     call addlib('PROJECT_REXX_PORT' , 0)
  138.     call addlib(TOASTERLIB,0)
  139.     call Switcher(TOWB)
  140.     address command "C:Wait 1"
  141.     ScreenToFront
  142.     end
  143.    if IAType = 1 then do
  144.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  145.     PicAName = result
  146.     Name = GetFileName(PicAName)
  147.     if Name = "" then do
  148.         Title = "You Must Enter A Valid Name To Use!"
  149.         RequestNotify Title
  150.         if FlyOn = 1 then Address FLY_1 Quit
  151.         exit
  152.         end
  153.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  154.     End = result
  155.     Start = 1
  156.     end
  157.    if IAType = 2 then do
  158.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  159.     PicAName = result
  160.     Name = GetFileName(PicAName)
  161.     if Name = "" then do
  162.         Title = "You Must Enter A Valid Name To Use!"
  163.         RequestNotify Title
  164.         if FlyOn = 1 then Address FLY_1 Quit
  165.         exit
  166.         end
  167.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  168.     End = result
  169.     Start = 1
  170.     end
  171.    if IAType = 3 then do
  172.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  173.     PicAName = result
  174.     Name = GetFileName(PicAName)
  175.     if Name = "" then do
  176.         Title = "You Must Enter A Valid Name To Use!"
  177.         RequestNotify Title
  178.         if FlyOn = 1 then Address FLY_1 Quit
  179.         exit
  180.         end
  181.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  182.     End = result
  183.     Start = 1
  184.     end
  185. return
  186.  
  187. CloseStuff:
  188.     Address FLY_1 Quit
  189.     call remlib('ToasterARexx.port')
  190.     call remlib('PROJECT_REXX_PORT')
  191. return
  192.  
  193.  
  194. OpenFlyStuff:
  195.     FlyOn = 1
  196.     address command "run VFXIFXCD:FLY" 
  197.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  198.         address command "wait 1"
  199.         end
  200.     TOASTERLIB="ToasterARexx.port"
  201.     call remlib('ToasterARexx.port')
  202.     call remlib('PROJECT_REXX_PORT')
  203.     call addlib('PROJECT_REXX_PORT' , 0)
  204.     call addlib(TOASTERLIB,0)
  205.     DriveName = FindDrive()
  206. return
  207.  
  208.  
  209. FindDrive:
  210.     address command "C:Info >RAM:DriveList"
  211.     call open TempFile,"RAM:DriveList",R
  212.     do until eof(TempFile)
  213.         line = readln(TempFile)
  214.         parse var line Drive" "Rest
  215.         if Drive = "FA0:" then 
  216.             FlyVolume = word(Rest,7)":"
  217.     end
  218.     call close TempFile
  219.     address command "Delete >NIL: RAM:DriveList"
  220. return FlyVolume
  221.  
  222. LoadA:
  223.     if IAType = 0 then do
  224.         LoadBuffer PicAName Force i
  225.         end
  226.     if IAType = 1 then do
  227.         LoadBuffer PicAName Force 1
  228.         end
  229.     if IAType = 2 then do
  230.         LoadBuffer PicAName Force
  231.         end
  232.     if IAType = 3 then do
  233.         LoadBuffer PicAName""right(i,3,'0') Force
  234.         end
  235. return
  236.  
  237.  
  238.  
  239.